﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Security.Principal;
using System.Threading.Tasks;

namespace Code {
    public static class IdentityExtension {
        public static string GetValue(this IIdentity identity, string Name) {
            var claim = ((ClaimsIdentity)identity).FindFirst(Name);
            return (claim != null) ? claim.Value : string.Empty;
        }

    }
}
